<template>
	<view class="">
		<view class="top-box">
			<u-collapse :item-style="itemStyle" arrow-color="#9A9A9A" :head-style="headStyle">
				<u-collapse-item :title="item.title" v-for="(item, index) in itemList" :key="index" :open="item.open">
					{{item.content}}
				</u-collapse-item>
			</u-collapse>
			<view class="q-box" @click="opinion">
				<view class="">意见反馈</view>
				<u-icon style="margin-right: 20rpx;" name="arrow-right" color="#9A9A9A"></u-icon>
			</view>
		</view>
		
		<view class="btn-box">
			<button type="default" open-type="contact" style="border-radius: 60rpx;background-color: #FF7A3C;font-size: 34rpx;color: #fff;">咨询客服</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				itemList: [],
				itemStyle: {
					borderBottom: '1rpx solid #E6E6E6',
					padding: '10rpx 0'
				},
				headStyle: {
					fontSize: '30rpx',
					color: '#343434'
				}
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				this.$ajaxRequest.get(this.baseUrl + 'shop/opinion/index', {}, true).then(res => {
					console.log(res)
					if (res.data.code == 200) {
						this.itemList = res.data.data
					} else {
						uni.showToast({
							title:res.data.msg,
							icon:'none'
						})
					}
				})
			},
			opinion() {
				uni.navigateTo({
					url: '/pages/user/yijian/index'
				})
			}
		}
	}
</script>

<style>
	.top-box {
		border-top: 20rpx solid #F8F8F8;
		border-bottom: 20rpx solid #F8F8F8;
		padding: 0 30rpx;
	}

	.q-box {
		display: flex;
		justify-content: space-between;
		padding: 30rpx 0;
	}
	.btn-box {
		padding: 118rpx 80rpx 0;
	}
</style>
